package ;
import easelhx.display.Graphics;
import easelhx.display.Shape;

/**
 * ...
 * @author 
 */

class GraphicsSimpleExample extends Example
{

	public function new() 
	{
		super();
	}
	
	override public function run():Void 
	{
		super.run();
		
		var s = drawSmiley();
		s.x = (960-350)/2;
		s.y = 20;
	    stage.addChild(s);
	    stage.update();
	}
	
	private function drawSmiley() : Shape
	{
	    var s:Shape = new Shape();
	    var g:Graphics = s.graphics;
	    //Head
	    g.setStrokeStyle(15, 'round', 'round');
	    g.beginStroke("#000");
	    g.beginFill("#F00");
	    g.drawCircle(170, 170, 170); //55,53
	    g.endFill();
	    g.setStrokeStyle(1, 'round', 'round');

	    //Right eye
	    g.setStrokeStyle(5, 'round', 'round');
	    g.beginStroke("#000");
	    g.beginFill("#000");
	    g.drawRoundRect(125, 64, 20, 50, 10);
	    g.endFill();

	    //Left eye
	    g.setStrokeStyle(5, 'round', 'round');
	    g.beginStroke("#000");
	    g.beginFill("#000");
	    g.drawRoundRect(200, 64, 20, 50, 10);
	    g.endFill();

	    //Mouth
	    g.setStrokeStyle(15, 'round', 'round');
	    g.beginStroke("#000");
	    g.moveTo(45, 155);
	    g.bezierCurveTo(83, 307, 254, 317, 296, 152);
	    return s;
	}

	
}